#pragma once

class Material
{
	D3DMATERIAL9 m_D3DMaterial;				// This structure stores diffuse, ambient, specular, emissive, and power.

	public:
		Material();

		void SetAmbient(const Color &color);

		const Color GetAmbient() { return m_D3DMaterial.Ambient; }

		void SetDiffuse(const Color &color);

		const Color GetDiffuse() { return m_D3DMaterial.Diffuse; }

		void SetSpecular(const Color &color, const float power);

		void GetSpecular(Color &_color, float &_power) 
			{ _color = m_D3DMaterial.Specular; _power = m_D3DMaterial.Power; }

		void SetEmissive(const Color &color);

		const Color GetEmissive() { return m_D3DMaterial.Emissive; }

		void SetAlpha(const float alpha);

		bool HasAlpha() const { return GetAlpha() != fOPAQUE; }

		float GetAlpha() const { return m_D3DMaterial.Diffuse.a; }

		void D3DUse9();
};